﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class my_htmlpiece : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
        }
        else
        {
            TUser.CheckUser(this);

            //根据登录的用户来指定其上传文件的路径
            string emailfolder = this.Session["ecrm_email"].ToString();
            Session["FCKeditor:UserFilesPath"] = "/easycrm/uploadfiles/" + emailfolder + "/";

            //设定状态
            if ((this.Session["ecrm_email"] == null) || (this.Session["ecrm_email"].ToString() == ""))
            {
                userstatus1.Text = "你好，请 <a href=\"main.aspx\">登录</a>或 ";
                userstatus2.Text = "<a href=\"./user/user_reg.aspx\">注册</a>";
            }
            else
            {
                string sid = this.Session["ecrm_uid"].ToString();
                TUser oUser = new TUser(sid);
                oUser.Select();
                string bigname = oUser.BigName;

                userstatus1.Text = "<a href=\"./user/user_myself.aspx\">" + bigname + "的设置</a>";
                userstatus2.Text = "<a href=\"./user/user_logout.aspx\">退出</a>";

                bigname0.Text = bigname;
            }
        }
    }
}
